package com.alpha.tables;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the conversation database table.
 * 
 */
@Embeddable
public class ConversationPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private int idconversation;

	@Column(name="caller_idemployee")
	private int callerIdemployee;

	@Column(name="called_idemployee")
	private int calledIdemployee;

    public ConversationPK() {
    }
	public int getIdconversation() {
		return this.idconversation;
	}
	public void setIdconversation(int idconversation) {
		this.idconversation = idconversation;
	}
	public int getCallerIdemployee() {
		return this.callerIdemployee;
	}
	public void setCallerIdemployee(int callerIdemployee) {
		this.callerIdemployee = callerIdemployee;
	}
	public int getCalledIdemployee() {
		return this.calledIdemployee;
	}
	public void setCalledIdemployee(int calledIdemployee) {
		this.calledIdemployee = calledIdemployee;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ConversationPK)) {
			return false;
		}
		ConversationPK castOther = (ConversationPK)other;
		return 
			(this.idconversation == castOther.idconversation)
			&& (this.callerIdemployee == castOther.callerIdemployee)
			&& (this.calledIdemployee == castOther.calledIdemployee);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.idconversation;
		hash = hash * prime + this.callerIdemployee;
		hash = hash * prime + this.calledIdemployee;
		
		return hash;
    }
}